// MyCtrls.h: interface for the CMyButton class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MYCTRLS_H__C69C71C7_9E87_4C6C_A4E4_A4EFD9C9117B__INCLUDED_)
#define AFX_MYCTRLS_H__C69C71C7_9E87_4C6C_A4E4_A4EFD9C9117B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "GenCtrlBase.h"

class CMyButton : public CGenCtrlBase  
{
public:
	CMyButton(CRect& rc, CWnd* parent, UINT id, CString caption = _T(""));
	virtual ~CMyButton();
	virtual HRESULT DrawCtrlPanel(CDC* pDC);
	virtual HRESULT LeftButtonDown(UINT nFlags, CPoint point);
	virtual HRESULT LeftButtonUp(UINT nFlags, CPoint point);
	virtual HRESULT OnMouseMoveInClient(UINT nFlags, CPoint point);
	virtual HRESULT OnMouseMoveOutClient();
protected:
	CMyButton(){};
	CRect m_rcText;

protected:
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	DECLARE_MESSAGE_MAP()

};

///////////////////////////////////////////////////////////////////
// MyComboBox
class CMyComboBox : public CGenCtrlBase  
{
public:
	CMyComboBox(CRect& rc, CWnd* parent, UINT id, CString caption = _T(""));
	virtual ~CMyComboBox();
 	virtual HRESULT DrawCtrlPanel(CDC* pDC);
 	virtual HRESULT LeftButtonDown(UINT nFlags, CPoint point);
 	virtual HRESULT LeftButtonUp(UINT nFlags, CPoint point);
	void InitComboBoxItem(CString* ppoint, int count);
	virtual HRESULT OnMouseMoveInClient(UINT nFlags, CPoint point);
		virtual HRESULT OnMouseMoving(UINT nFlags, CPoint point);
	CString GetItemText(UINT i);
	UINT GetCurSelIndex();

protected:
	CMyComboBox(){};
	UINT m_uiSelIndex;
	UINT m_uiItemCount;
	std::vector<CString> m_vItems;
	CRect m_rcArrowBtn;
	CPoint m_ptArrow[3];
	//CRect m_rcSelItem;
	CRect m_rcCaption;
	BOOL m_bPushArrowBtn;
	BOOL m_bShowList;
	CRect m_rcItemList;
	CRect m_rcClientBK;
	UINT m_uiIndexMouseOn;
	
};

class CMyEdit : public CGenCtrlBase  
{
public:
	CMyEdit(CRect& rc, CWnd* parent, UINT id, CString caption = _T(""));
	virtual ~CMyEdit();
	virtual HRESULT DrawCtrlPanel(CDC* pDC);
	virtual HRESULT LeftButtonDown(UINT nFlags, CPoint point);
	virtual HRESULT LeftButtonUp(UINT nFlags, CPoint point);
	virtual HRESULT OnMouseMoveInClient(UINT nFlags, CPoint point);
	virtual HRESULT OnMouseMoveOutClient();

	CString SetEditItem(CString item);
	CString GetEditItem();
protected:
	CMyEdit(){};
	CRect m_rcText;
	CRect m_rcCaption;
	
};

class CMySlider : public CGenCtrlBase  
{
public:
	CMySlider(CRect& rc, CWnd* parent, UINT id, CString caption = _T(""));
	virtual ~CMySlider();
	virtual HRESULT DrawCtrlPanel(CDC* pDC);
	virtual HRESULT LeftButtonDown(UINT nFlags, CPoint point);
	virtual HRESULT LeftButtonUp(UINT nFlags, CPoint point);
	virtual HRESULT OnMouseMoving(UINT nFlags, CPoint point);
protected:
	CMySlider(){};
	CRect m_rcSlider;
	CRect m_rcBlock;
	CPoint m_pointMousedown;
	BOOL m_bPressBlock;
		
};

class CMyProcessBar : public CGenCtrlBase  
{
public:
	CMyProcessBar(CRect& rc, CWnd* parent, UINT id, CString caption = _T(""));
	virtual ~CMyProcessBar();
	virtual HRESULT DrawCtrlPanel(CDC* pDC);
	void SetProcessBarPos(double percent);
protected:
	CMyProcessBar(){};
	CRect m_rcProcessBar;
	double m_lfPercent;

};

class CMyCheckBox : public CGenCtrlBase  
{
public:
	CMyCheckBox(CRect& rc, CWnd* parent, UINT id, CString caption = _T(""));
	virtual ~CMyCheckBox();
	virtual HRESULT DrawCtrlPanel(CDC* pDC);
 	virtual HRESULT LeftButtonDown(UINT nFlags, CPoint point);
 	virtual HRESULT LeftButtonUp(UINT nFlags, CPoint point);
// 	virtual HRESULT OnMouseMoveInClient(UINT nFlags, CPoint point);
// 	virtual HRESULT OnMouseMoveOutClient();
	void SetChecked(BOOL check);
	BOOL GetChecked();
protected:
	CMyCheckBox(){};
	CRect m_rcCheck;
	CRect m_rcCaption;
	BOOL m_bChecked;

};

class CMyRadioBtn : public CGenCtrlBase  
{
public:
	CMyRadioBtn(CRect& rc, CWnd* parent, UINT id, CString caption = _T(""));
	virtual ~CMyRadioBtn();
	virtual HRESULT DrawCtrlPanel(CDC* pDC);
	virtual HRESULT LeftButtonDown(UINT nFlags, CPoint point);
	void SetChecked(BOOL check);
	BOOL GetChecked();
protected:
	CMyRadioBtn(){};
	CRect m_rcCheck;
	CRect m_rcCaption;
	BOOL m_bChecked;
	
};

class CMyStatic : public CGenCtrlBase  
{
public:
	CMyStatic(CRect& rc, CWnd* parent, UINT id, CString caption = _T(""));
	virtual ~CMyStatic();
	virtual HRESULT DrawCtrlPanel(CDC* pDC);
protected:
	CMyStatic(){};
	CRect m_rcCaption;
	
};

class CMyGroupBox : public CGenCtrlBase  
{
public:
	CMyGroupBox(CRect& rc, CWnd* parent, UINT id, CString caption = _T(""));
	virtual ~CMyGroupBox();
	virtual HRESULT DrawCtrlPanel(CDC* pDC);
protected:
	CMyGroupBox(){};
	CRect m_rcTitle;
	CRect m_rcFrame;
};

#endif // !defined(AFX_MYCTRLS_H__C69C71C7_9E87_4C6C_A4E4_A4EFD9C9117B__INCLUDED_)
